class FindActiveRecordAction < WorkflowAction
  def valid_input_classes
    []
  end
  
  def output_class
    ActiveRecord::Base
  end
  
  def model=(model)
    raise "#{model.to_s} is not a class" unless model.class == Class
    options[:model] = model.to_s
  end
  
  def model
    options[:model].constantize
  end
  
  def execute
    @output = if self.conditions.nil?
      model.find(:all)
    else
      model.find(:all, :conditions => self.conditions)
    end
  end
end